<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Alejandro Casas
 * Date: 1/28/13
 * Time: 8:34 PM
 * To change this template use File | Settings | File Templates.
 */
require 'DataLoader.php';

include('httpful-0.2.0.phar');
class CommonWSEvent
{
    private $client;
    public function __construct() {
        $this->client = $_SESSION['base_server_url'];
    }

    public function GetEventInfo($id)
    {

        $uri=$this->client."GetEventInfo/".$id;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }


    public function GetEventparticipationRequest($id)
    {
        $uri=$this->client."GetEventparticipationRequest/".$id;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }


    public function AcceptEventParticpationRequest($eventId,$mail)
    {
        $uri=$this->client."AcceptEventParticpationRequest/".$eventId."/".$mail;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }


    public function RejectEventParticipationRequest($eventId,$mail)
    {
        $uri=$this->client."RejectEventParticipationRequest/".$eventId."/".$mail;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }


    public function GetEventRegisteredParticipants($eventId)
    {
        $uri=$this->client."GetEventRegisteredParticipants/".$eventId;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }

    public function ReportEvent($eventId,$mailReporter,$message)
    {
        $uri=$this->client."ReportEvent/".$eventId."/".$mailReporter."/".$message;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }

    public function CreateEvent($mailOwner,$title,$address,$description,$ending_date,$starting_date,$lat,$lng,$miniPicture,$picture,
                                $openings,$privacy,$sports,$city,$country)
    {
        $uri=$this->client."CreateEvent/".$mailOwner."/".$title."/".$address."/".$description."/".$ending_date."/".$starting_date."/".$lat."/".$lng."/".$miniPicture."/".$picture."/".$openings."/".$privacy."/".$sports."/".$city."/".$country;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }


    public function GetUserEvents($mail)
    {
        $uri=$this->client."GetUserEvents/".$mail;
        $r = \Httpful\Request::get($uri)->sendIt();
        return $r;
    }

}
